From: Philip Withnall Date: Thu, 20 Nov 2025 16:37:58 +0000 (+0000) Subject: runDialog: Disable internal commands if parental controls are enabled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~89 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dc818732de69d54c30ecef8556ae4f9fa6aa8325;p=gnome-shell.git runDialog: Disable internal commands if parental controls are enabled This reduces the chance of the child user being able to monkey patch gnome-shell to disable things like screen time limits using Looking Glass. Spotted by Sergey Bugaev. Signed-off-by: Philip Withnall Part-of: --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 89ae38190..faf9e0e0e 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -8,6 +8,7 @@ import St from 'gi://St'; import * as Dialog from './dialog.js'; import * as Main from './main.js'; import * as ModalDialog from './modalDialog.js'; +import * as ParentalControlsManager from '../misc/parentalControlsManager.js'; import * as ShellEntry from './shellEntry.js'; import * as Util from '../misc/util.js'; import * as History from '../misc/history.js'; @@ -29,6 +30,11 @@ class RunDialog extends ModalDialog.ModalDialog { destroyOnClose: false, }); + this._parentalControlsManager = ParentalControlsManager.getDefault(); + this._parentalControlsManager.connect('notify::any-parental-controls-enabled', () => { + this._updateEnableInternalCommands(); + }); + this._lockdownSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA}); this._terminalSettings = new Gio.Settings({schema_id: TERMINAL_SCHEMA}); global.settings.connect('changed::development-tools', () => { @@ -119,7 +125,9 @@ class RunDialog extends ModalDialog.ModalDialog { } _updateEnableInternalCommands() { - this._enableInternalCommands = global.settings.get_boolean('development-tools'); + this._enableInternalCommands = + !this._parentalControlsManager.anyParentalControlsEnabled && + global.settings.get_boolean('development-tools'); } vfunc_key_press_event(event) {